using UnityEngine;

namespace Client.Hotfix
{
    public class LoginModule : BaseModule
    {
        private string login_token;
        public LoginModule(GameModule gameModule) : base(gameModule) { }

        public override void OnEnter()
        {
            if (HasToken(out login_token))
            {
                FastLogin();
            }
            else
            {
                NormalLogin();
            }
        }

        private void FastLogin()
        {

        }

        private void NormalLogin()
        {

        }

        private bool HasToken(out string token)
        {
            token = PlayerPrefs.GetString(PlayerPrefsDefine.Login_Token, "");
            return !string.IsNullOrEmpty(token);
        }

        private void SaveToken()
        {
            if (!string.IsNullOrEmpty(login_token))
                PlayerPrefs.SetString(PlayerPrefsDefine.Login_Token, login_token);
        }
    }

}
